use core::{Package, PackageId, Summary, Registry, Dependency};
use util::{CargoResult, Config, to_hex};
use sources::PathSource;
-use sources::git::utils::{GitReference,GitRemote,Master,Other};
+use sources::git::utils::{GitReference, GitRemote, Master, Other, GitRevision};
/* TODO: Refactor GitSource to delegate to a PathSource
*/
checkout_path: Path,
source_id: SourceId,
path_source: Option<PathSource>,
- config: &'a mut Config<'b>
+ rev: Option<GitRevision>,
+ config: &'a mut Config<'b>,
}
impl<'a, 'b> GitSource<'a, 'b> {
checkout_path: checkout_path,
source_id: source_id.clone(),
path_source: None,
- config: config
+ rev: None,
+ config: config,
}
}
let path_source = PathSource::new(&self.checkout_path, &source_id);
self.path_source = Some(path_source);
+ self.rev = Some(actual_rev);
self.path_source.as_mut().unwrap().update()
}
}
fn fingerprint(&self, _pkg: &Package) -> CargoResult<String> {
- let db = self.remote.db_at(&self.db_path);
- db.rev_for(self.reference.as_slice()).map(|r| r.to_string())
+ Ok(self.rev.get_ref().to_string())
}
}